<?php

	// the p[aram is the user to follow.

	$moduleRequest = "";

	if (isset($_REQUEST['param']))
		$moduleRequest = $_REQUEST['param'];

	@session_start();
	require_once('../toath/twitteroauth/twitteroauth.php');
	require_once('../toath/config.php');

	if (empty($_SESSION['access_token']) || empty($_SESSION['access_token']['oauth_token']) || empty($_SESSION['access_token']['oauth_token_secret']))
	{
	}
	else
	{
		/* Get user access tokens out of the session. */
		$access_token = $_SESSION['access_token'];
		$connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, $access_token['oauth_token'], $access_token['oauth_token_secret']);
		$content = $connection->get('users/show', array('screen_name' => $moduleRequest));
		$targetid = $content->id;
		$connection->post('friendships/destroy', array('id' => $targetid));

	}

	echo "--nopost";
?> 
